#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    pushButton = new QPushButton(this);
    connect(pushButton,&QPushButton::clicked,  this, &Widget::Handler);
    pushButton->setText("hello world");
    pushButton->move(100,100);
}
void Widget::Handler()
{
    if (pushButton->text() == QString("hello world")) {
        pushButton->setText("hello qt");
    } else {
        pushButton->setText("hello world");
    }
}
Widget::~Widget()
{
    delete ui;
}

